package com.bobi.tfca.model.vo;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableId;
import com.bobi.tfca.model.entity.ArticleEntity;
import com.bobi.tfca.model.entity.MemberEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.gson.Gson;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author 李文发
 * @date 2024/4/3
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "用户")
public class MemberVO implements Serializable {

    @Serial
    private static final long serialVersionUID = -5446272539547398376L;

    // 会员id
    @ApiModelProperty(value = "会员id")
    private Integer memberId;
    @ApiModelProperty(value = "会员姓名")
    // 会员姓名
    private String memberName;
    @ApiModelProperty(value = "出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    // 出生日期
    private LocalDateTime birthday;
    @ApiModelProperty(value = "性别")
    // 性别
    private String sex;
    @ApiModelProperty(value = "联系电话")
    // 联系电话
    private String telephone;
    @ApiModelProperty(value = "电子邮箱")
    // 电子邮箱
    private String email;
    @ApiModelProperty(value = "密码")
    // 密码
    private String password;
    @ApiModelProperty(value = "在会状态（0：待审核，1：在会，2：退会）")
    // 在会状态（0：待审核，1：在会，2：退会）
    private Integer memberStatus;
    @ApiModelProperty(value = "职务")
    // 职务
    private String role;
    @ApiModelProperty(value = "头像")
    private String picture;
    @ApiModelProperty(value = "会龄")
    private String memberAge;
    @ApiModelProperty(value = "入会日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate entryDate;
    @ApiModelProperty(value = "退会日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate exitDate;
    @ApiModelProperty(value = "留言")
    private String leaveWords;

    public static MemberEntity ofMemberVO(MemberVO memberVO) {
        MemberEntity entity = new MemberEntity();
        BeanUtil.copyProperties(memberVO, entity);
        return entity;
    }
}
